const Path = require("path");

const SERVER_HOST = "http://localhost:3000";

/**用户类型，前后端对应 1-管理员 2-医生 3-病人 4-游客*/
const USER_TYPES = {
  ADMINISTATOR: 1,
  DOCTOR: 2,
  PATIENT: 3,
  VISITOR: 4,
};

const DOCTOR_VALID_STATUS = {
  UNVALID: 1,
  ONVALID: 2,
  FAILD: 3,
  VALID: 4,
};

const PB_TYPE = {
  DATE: 7, //周
  TIME: 3, //早中晚
};

const TIME_TYPE = {
  MORNING: 1,
  NOON: 2,
  EVENING: 3,
};

const TIME_TYPE_DESC = {
  [TIME_TYPE.MORNING]: "上午",
  [TIME_TYPE.NOON]: "下午",
  [TIME_TYPE.EVENING]: "晚上",
};

const OUTPATIENT_TYPES = {
  GNERAL: 1,
  SPECIALIST: 2,
};

const APPLY_STATUS = {
  PENDING: 1,
  RESOVED: 2,
  TIMEOUT: 3,
};

const USER_TOKEN_SECRET_KEY = "USER_TOKEN_SECRET_KEY";

const TOKEN_ISSUE_KEY = "USER_IDENTIFY_TOKEN";

const JWT_WHITE_LIST = ["/api/user/join", "/api/user/login"];

const UPLOAD_FILE_DIR = Path.resolve(`${__dirname}/public`);

module.exports = {
  USER_TYPES,
  DOCTOR_VALID_STATUS,
  SERVER_HOST,
  PB_TYPE,
  APPLY_STATUS,
  TIME_TYPE,
  TIME_TYPE_DESC,
  OUTPATIENT_TYPES,
  USER_TOKEN_SECRET_KEY,
  TOKEN_ISSUE_KEY,
  JWT_WHITE_LIST,
  UPLOAD_FILE_DIR,
};
